public class PloOutput {

	private Ids idList;
	
	public PloOutput(Tokens tokens) {
		this.parse(tokens);
	}

	public void parse(Tokens tokens){
		// check for "write"
		if(tokens.getToken() != 11){
			System.err.println("Keyword \"write\" expected before token: " + tokens.idName());
			System.exit(0);
		}
		tokens.skipToken();
		this.idList = new Ids(tokens);
		// check for ";"
		if(tokens.getToken() != 12){
			System.err.println("Semicolon expected before token: " + tokens.idName());
			System.exit(0);
		}
		tokens.skipToken();
	}

	public void runOutput() {
		System.out.println("WRITE:  " + this.idList.getCurrentID() + " = " 
				+ Id.getVal(this.idList.getCurrentID()));	
	}
}